package com.wanmait.wisdom.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.wanmait.wisdom.entity.Resident;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.Date;
import java.util.List;

/**
* Created by Mybatis Generator 2024/04/27
*/
@Mapper
public interface ResidentMapper extends BaseMapper<Resident> {

    int deleteByPrimaryKey(Integer id);

    int insert(Resident record);

    int insertSelective(Resident record);

    Resident selectByPrimaryKey(Integer id);

    int updateByPrimaryKeySelective(Resident record);

    int updateByPrimaryKey(Resident record);

    void updateEmail(@Param("id") Integer id, @Param("email") String email);

    void updatePhone1(@Param("id") Integer id, @Param("phone1") String phone1);

    void updatePhone2(@Param("id") Integer id, @Param("phone2") String phone2);

    int getCountByParkingId(@Param("id") Integer id);

    //查找该房屋下有多少居民
    Integer checkPersonSize( @Param("id") Integer id);

    List<Resident> findAllResident( @Param("resident") Resident searchResident, @Param("startTime") Date startTime, @Param("endTime") Date endTime);

    //删除居民信息
    void deleteResident(@Param("id") Integer id);

    Integer getCountByPhone(@Param("phone")String phone);
}